<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/info', function () {
  phpinfo();
});

Route::get('/', function () {
  return redirect('admin', 302);
});

// 微信部分路由
Route::group(['prefix' => 'wechat'], function () {
  Route::any('/', 'weChatController@index' );
});

// 小程序
Route::group(['prefix' => 'applets'], function () {
  Route::any('/', 'AppletsController@index' );
});

// 微信页面
Route::group(['prefix' => 'web'], function () {
  Route::any('/index', 'WebController@index' );
});


// 设计模式部分的路由
Route::group(['prefix' => 'design','namespace'=>'Test\Design'], function () {
  //管道
  Route::group(['prefix' => 'pipe'], function () {
    Route::any('show', 'PipeController@show' );
  });
});

Auth::routes();

// Route::get('/home', 'HomeController@index')->name('home');
Route::get('/home', function () {
  return redirect('admin', 302);
});


Route::group(['prefix' => 'admin', 'namespace' => 'Admin', 'middleware' => 'auth'], function()
{
  Route::get('/', 'HomeController@index');

  // 
  Route::group(['prefix' => 'cocktail','namespace'=>'Cocktail'], function () {

    // 文章列表
    Route::group(['prefix' => 'aticle'], function () {
      Route::any('list', 'ArticleController@list' );
      Route::any('add', 'ArticleController@add' );
      Route::any('edit/{id}', 'ArticleController@edit' );
    });
    

    // 搜索词列表
    Route::group(['prefix' => 'search'], function () {
      Route::any('list', 'SearchController@list' );
    });


  });



});
